﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MP/backend.Master" AutoEventWireup="true" CodeBehind="DoiTac.aspx.cs" Inherits="TimViec.backend.DoiTac" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h4 class="alert_info">Quản lý đối tác</h4>
    <div class="module width_full">
        <div class=p_10>
            <span style="color: red;">Chú ý:</span><span>Kích thước logo: width:150px; height:auto</span>
            <table cellpadding="0" cellspacing="0" width="100%">                
                <tr>
                    <td valign="top" style="width: 49%;">
                        <table cellpadding="0" cellspacing="10">
                            <tr>
                                <td><strong>Tên đối tác</strong></td>
                                <td><asp:TextBox runat="server" ID="txtName" Width="300px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Text="*"
                                    ErrorMessage="Tiêu đề" ControlToValidate="txtName" ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Logo</strong></td>
                                <td><asp:FileUpload runat="server" ID="File_UpLoadImage"/>
                                     <asp:RegularExpressionValidator ID="ktraanhnho" runat="server" Text="*"
                                        ErrorMessage="File không phải hình ảnh!" ControlToValidate="File_UpLoadImage" 
                                        ForeColor="Red" 
                                        ValidationExpression="^([0-9a-zA-Z_\-~. :\\])+(.jpg|.JPG|.jpeg|.JPEG|.bmp|.BMP|.gif|.GIF|.png|.PNG)$"></asp:RegularExpressionValidator>                                    
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Website</strong></td>
                                <td><asp:TextBox runat="server" ID="txtLink" Width="300px"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    <asp:Button runat="server" ID="btSave" CssClass="buttonNew" Text="Lưu lại" 
                                        onclick="btSave_Click"/>
                                    <asp:Button runat="server" ID="btUpdate" CssClass="buttonNew" Text="Cập nhật" 
                                        Visible="False" onclick="btUpdate_Click"/>
                                    <asp:Button runat="server" ID="btCancel" CssClass="buttonCancel" Text="Hủy bỏ" 
                                        CausesValidation="False" onclick="btCancel_Click"/>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td valign="top">
                        <strong>Danh sách đối tác</strong><br/>
                        <asp:Literal runat="server" ID="lbDoiTacId" Visible="False"></asp:Literal>
                        <table cellspacing="0" cellpadding="0" width="100%" class="tablesorter">
                            <thead>
                                <tr>
                                    <th>STT</th>
                                    <th>Tên đối tác</th>
                                    <th>Images</th>
                                    <th>website</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <asp:Repeater runat="server" ID="rptDoiTac" 
                                onitemcommand="rptDoiTac_ItemCommand">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Container.ItemIndex+1 %></td>
                                        <td><%#Eval("Name") %></td>
                                        <td><img src="<%#Eval("Images") %>" width="100px"/></td>
                                        <td><%#Eval("Link") %></td>
                                        <td>
                                            <asp:LinkButton runat="server" ID="lbtEdit" CommandName="Edit" CommandArgument='<%#Eval("DoiTacId") %>' ToolTip="Cập nhật" CausesValidation="False"><img src="../images/backend/icn_edit.png" width="16px"/></asp:LinkButton>
                                            <asp:LinkButton runat="server" ID="LinkButton1" CommandName="Delete" CommandArgument='<%#Eval("DoiTacId") %>' ToolTip="Xóa" CausesValidation="False" OnClientClick="return window.confirm('Bạn chắc muốn xóa')"><img src="../images/backend/icn_trash.png" width="16px"/></asp:LinkButton>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Các trường có dấu (*) bắt buộc phải nhập"
                ShowMessageBox="True" ShowSummary="False" />
</asp:Content>
